Compare Signals
Overview
This test metric compares the similarity between signals using:
- Peak Signal - maximum absolute value of signal
- Mean Residual - average of differences between the signals
- Standard Deviation of Residual
- Percentage Outside Corridor - percentage of residauls that exceed defined corridor size
- Cosine Similarity - measures the cosine angle between the signals (treated as vectors)
- T-statistic - determines if the signal's residual values are significantly different from the reference signal's residuals
- Temporal Moment Differences - the difference in moments between the signal and reference signal
- Min and Max Time - represents the starting and ending time of the signal to ensure both signals are aligned in time
Required Input
- Signal or signals to compare to reference signal
- Reference signal
- if not signal is provided, fist signal will be used as reference signal
Calculation
- Checks units of signal to ensure consistency and converts units if necessary
- Applies band-pass filter to both the input and reference signal to remove noice
- Signals are truncated to specified time range (if applicable)
- Reference Signal is calculated (if not provided)
- If no reference signal is present, input signal is converted to a list of signals
- Input singal is resampled to the same time step between data points
- Signals are truncated to common time range
- Reference signal is calculated as the average of all input signals
- Comparison Metrics are calculated (see steps 1-8 in overview section)
- Residual signal is calculated by finding the difference between the input and reference signal
- Two corridor signals are created
- Standard Deviation-based Corridor: defined as the reference signal +/- the average standard deviation of the residuals
- 90% Confidence Interval-based Corridor: based on a 90% confidence interval around the reference signal
- Cumulative density curves are calculated to understand the distribution of residuals
- Data is assorted in ascending order (smalles to largest values)
- Cumulative probability is calculated
- Proportion of data points that are less than or equal to a particular value
- Plot cumulative distribution function using calculated cumulative probabilites at each point
- Cross-correlation curves are calculated to understand how signals align over various time shifts
- Input signal is "shifted" by different amounts to calculate cross correlation at various time shifts
- Cross correlation is calculated over a range of time shifts to result in a curve showing the similarity between signal changes as input signal is shifted over time
- Output created including
- Summary table with all comparison metrics for each signal
- Input signals after filtering, resampling, and truncating
- Reference signal
- Corrdior signals with the lower and upper bounds for the corridor
- Residual signals
- Cumulative density curves
- Cross-correlation curves